<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title></title>
	</head>
	<body>
		
	</body>
	<script type="text/javascript">
		// ES6 允许按照一定模式从数组和对象中提取值,对变量进行赋值   被称为:解构赋值
		
		// 1. 数组的解构
		/* const F4 = ["小沈阳","刘能","赵四","宋小宝"];
		let [小,liu,Z,song] = F4;
		console.log(小);//小沈阳
		console.log(liu);//刘能
		console.log(Z);//赵四
		console.log(song);//宋小宝 */
		
		// 2. 对象的解构
		const zhao = {
			name:"赵本山",
			age:"不详",
			xiaopin:function(){
				console.log("我可以演小品");
			}
		}
		// zhao.xiaopin();//我可以演小品
		
		/* let {name,age,xiaopin} = zhao;
		console.log(name);
		console.log(age);
		console.log(xiaopin);
		xiaopin();// 调用方法  我可以演小品 */
		
		// 也可以单独
		let {xiaopin} = zhao;
		xiaopin();//我可以演小品
	</script>
</html>